package com.tuanzi.loan.web.bean.galaxycard;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;

import lombok.Data;
import lombok.EqualsAndHashCode;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.tuanzi.loan.business.service.galaxycard.GalaxyCardOrderService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.vo.request.galaxycard.GalaxyCardOrderRequest;
import com.tuanzi.loan.vo.response.galaxycard.GalaxyCardOrderResponse;
import com.tuanzi.loan.web.configuration.JSFListingBean;
import com.tuanzi.loan.web.lazy.galaxycard.GalaxyCardOrderLazyDataModel;

/**
 * 银河黑卡订单列表Bean
 * @author chenweijun 2018/01/08
 *
 */
@Data
@Debug
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class GalaxyCardOrderListBean extends JSFListingBean<GalaxyCardOrderRequest, GalaxyCardOrderResponse> {
	 
	 
	private static final long serialVersionUID = 3469366783016301393L;
	
	@Autowired
	private GalaxyCardOrderService galaxyCardOrderService;
	
	@PostConstruct
	private void init() {
		initLazyDataModel();
	}
	
	private void initLazyDataModel() {
		$ = new GalaxyCardOrderRequest();
		lazyDataModel = new GalaxyCardOrderLazyDataModel($);
	}
	
	public String translateOrderStataus(Integer orderStatus){
		
		switch (orderStatus) {
			case 0:
				return "待支付";
	
			case 2:
				return "已完成";
				
			default:
				return "未定义";
		}
	}
	
	
	public String translatePayType(Integer payType){
		switch (payType) {
			case 1:
				return "支付宝APP支付";
				
			case 2:
				return "微信公众号支付";
				
			case 3:
				return "微信H5支付";
			
			case 7:
				return "支付宝H5支付";
	
			default:
				return "未定义";
		}
	}
	

}
